package com.hwtx.form.domain.repo;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hwtx.form.domain.def.FormDef;
import com.hwtx.form.domain.def.FormProperties;
import com.hwtx.form.dto.FormDefDto;
import com.hwtx.form.dto.FormQuery;
import com.hwtx.form.persistence.FormChangeLog;
import com.hwtx.form.persistence.entity.FormDefEntity;

import java.util.List;


/**
 * 表单定义 服务接口
 *
 * @author hwtx
 * @since 2023-12-10
 */
public interface FormRepo extends IService<FormDefEntity> {

    Long getAppendToFormId(Long formId);

    /**
     * 添加表单定义
     */
    long addFormDef(FormDefDto dto) throws Exception;

    Long genFormId(Long formId);

    /**
     * 修改表单定义
     */
    boolean updateFormDef(FormDefDto dto) throws Exception;

    /**
     * 删除表单定义
     */
    boolean deleteFormDef(Long id);

    boolean containsFormDef(Long formId);

    boolean containsFormDef(String formName);

    /**
     * 表单定义详情
     */
    String getFormRawContentById(Long formId) throws Exception;

    String getFormRawContentByName(String formName) throws Exception;

    FormDef getFormDefByName(String formName);

    /**
     * App表单定义详情
     */
    FormDef getFormDef(Long formId);


    void saveFormChangeLog(FormChangeLog formChangeLog);

    String getFormNameById(Long formId);

    Long getFormIdByName(String name);

    String getFormTypeById(Long formId);

    List<FormProperties> listFormInfo(FormQuery formQuery);

    List<String> listFormType();
}
